package com.resign.carl.command.example2.api.impl;

import com.resign.carl.command.example1.api.Command;
import com.resign.carl.command.example2.api.CeilingFan;

/**
 * Created by carl.zhao on 2016/6/15.
 */
public class CeilingFanOnCommand implements Command {

    private CeilingFan ceilingFan;

    public CeilingFanOnCommand(CeilingFan ceilingFan){
        this.ceilingFan = ceilingFan;
    }

    @Override
    public void execute() {
        ceilingFan.on();
    }

    @Override
    public void undo() {
        ceilingFan.off();
    }
}
